package qfredis


import (
	"github.com/gin-gonic/gin"
	"sync"
)


const (
	qfCommonLockKey string = "qf_common_locker"
)

var qfCommonMutex sync.Mutex

// QFCommonLock def
type QFCommonLock struct {
	qfCommonMutex sync.Mutex
}

var QFCommonLocker QFCommonLock

// Lock def
func (m QFCommonLock) Lock(ctx *gin.Context) bool {
	lock, _ := Lock(ctx, m.qfCommonMutex, qfCommonLockKey, "1", 10)
	return lock
}

// UnLock def
func (m QFCommonLock) UnLock(ctx *gin.Context) {
	UnLock(ctx, m.qfCommonMutex, qfCommonLockKey)
}